(function(){
    var factory = {
        init: function(){
            var _this = this;
            _this.scrollLoadingPic();
        },
        /* 图片懒加载 */
        scrollLoadingPic:function () {
            $("img.lazy").lazyload();
        },
        /* tab悬浮切换 */
        toggleTab: function(event){
              var _this = this;
              var currIndex = event.currentTarget.getAttribute("data-index");
              var prevIndex = $("#tab-list .active").attr("data-index");
              if (currIndex === prevIndex) return;
              $(event.currentTarget).addClass('active').siblings().removeClass('active');
              $("#"+prevIndex+"-img").removeClass('show').addClass('fade');
              $("#"+prevIndex+"-text").removeClass('show').addClass('fade');
              setTimeout(function(){
                $("#"+currIndex+"-img").removeClass('hide').addClass('show').siblings().addClass('hide').removeClass('fade');
                $("#"+currIndex+"-text").removeClass('hide').addClass('show').siblings().addClass('hide').removeClass('fade');
              }, 300)
        },
        /* 悬浮显示增值服务信息 */
        showServiceDetail: function(event){
              var _this = this;
              $(event.currentTarget).addClass('active').siblings().removeClass('active');
        }
    };

    module.exports = factory;
})();
